$tfam = $ARGV[0];
chomp($tfam);
$qc = $ARGV[1];
chomp($qc);
$qc_new = $ARGV[2];
chomp($qc_new);
open(BUFF,$tfam) or die "no file tfam $tfam found\n";
while(<BUFF>)
{
	chomp($_);
	@a = split(" ",$_);
	$hash{$a[1]} =1;
}
open(BUFF,$qc) or die "no file qc $qc found\n";
open(WRBUFF,">$qc_new") or die "not able to write the file\n";
$line = <BUFF>;
print WRBUFF $line;
while(<BUFF>)
{
        chomp($_);
        @a = split("\t",$_);
	if(exists($hash{$a[0]}) && $a[1] eq "Y")
	{
		print WRBUFF $_."\n";
	}
}
